﻿<%@ page title="" language="C#" masterpagefile="~/Admin/MasterPage.master" autoeventwireup="true" inherits="Admin_Products_Product, App_Web_i4j30p1c" %>
<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Button ID="btnAddProduct" CssClass="buttonblue" PostBackUrl="~/Admin/Products/ProductDetail.aspx" runat="server" Text="Thêm Sản Phẩm" />
    <br />
    <br />
    <br />
    <asp:GridView ID="gvProduct" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" Width="100%" AllowSorting="True" CellPadding="10" ForeColor="#333333" GridLines="None" PageSize="100" OnRowCommand="gvProduct_RowCommand">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="ProductID" HeaderText="Mã" InsertVisible="False" ReadOnly="True" SortExpression="ProductID" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Title" HeaderText="Tiêu đề" SortExpression="Title" />
            <asp:TemplateField HeaderText="Hình đại diện" SortExpression="Image">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
<%--                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Image") %>'></asp:Label>--%>
                    <asp:Image ID="Image1" runat="server" Height="50px" ImageUrl='<%# "~/UserUploads/Product/"+ Eval("Image") %>' />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:BoundField DataField="Editdate" HeaderText="Cập nhật" SortExpression="Editdate" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Vip" HeaderText="Nổi bật" SortExpression="Vip" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>
            <%--<asp:CheckBoxField DataField="Sale" HeaderText="Slider" SortExpression="Sale" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>--%>
            <asp:BoundField DataField="Order" HeaderText="Vị trí" SortExpression="Order" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Status" HeaderText="Hiển thị" SortExpression="Status" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:CheckBoxField>
            <asp:TemplateField HeaderText="Chức năng">
                <ItemTemplate>
                    <asp:HyperLink ID="hplEdit" runat="server" NavigateUrl='<%# Eval("ProductID","~/Admin/Products/ProductDetail.aspx?ProductID={0}") %>' Font-Bold="True">Sửa</asp:HyperLink>
                    &nbsp;&nbsp;&nbsp;
                    <asp:LinkButton ID="btnXoa" runat="server" CommandArgument='<%# Eval("ProductID") %>' Font-Bold="True">Xóa</asp:LinkButton>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <div style="width: 500px;">
        <cc1:collectionpager id="CollectionPager1" runat="server" backnextlocation="Split" slidersize="5" backnextdisplay="HyperLinks" firsttext="Đầu" lasttext="Cuối" nexttext=" &amp;nbsp; Sau >>" backtext="<< Trước &amp;nbsp;" showfirstlast="True" showpagenumbers="True" hideonsinglepage="True" sectionpadding="5" showlabel="False" resultslocation="None">
        </cc1:collectionpager>
    </div>
    <br />
    <br />
</asp:Content>

